﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RealState.BLL;
using RealState.BusinessObjects;
using log4net;

namespace RealState.W.AdminPanel
{
    public partial class TradeType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["Action"]))
            {
                switch (Request.QueryString["Action"].ToLower())
                {
                    case "create":
                        Control CategoryAdd = LoadControl("~/AdminControl/TradeTypeC.ascx");
                        Page.Form.FindControl("ContentPlaceHolder1").Controls.Add(CategoryAdd);
                        break;
                    case "list":
                        LoadData();
                        break;
                    case "edit":
                        Control CategoryEdit = LoadControl("~/AdminControl/TradeTypeE.ascx");
                        Page.Form.FindControl("ContentPlaceHolder1").Controls.Add(CategoryEdit);
                        break;
                }
            }
            else
            {
                LoadData();
            }
        }
        private void LoadData()
        {
            Control CategoriesList = LoadControl("~/AdminControl/TradeTypeL.ascx");
            Page.Form.FindControl("ContentPlaceHolder1").Controls.Add(CategoriesList);
        }
    }
}
